﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using DevExpress.Xpo;
using Aij1.Model;
using Aij1.BLL;
using System.Collections;

namespace Aij1.Cms
{
    public class BaseControl : UserControl
    {
        public Session XpoSession;
        public S_Person CurrentUser;
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (Page is BasePage)
            {
                XpoSession = ((BasePage)Page).XpoSession;
                CurrentUser = ((BasePage)Page).CurrentUser;
            }
            else
            {
                if (XpoSession == null) XpoSession = XpoHelper.GetNewSession();
                if (CurrentUser == null) CurrentUser = AuthData.GetCurrentUser(XpoSession);
            }
        }
    }
}